package com.sleep.psy.external_server.business.evaluation.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sleep.psy.external_server.business.evaluation.entity.EvaluationRecord;
import com.sleep.psy.external_server.business.evaluation.entity.EvaluationReport;
import com.sleep.psy.external_server.business.evaluation.entity.dto.ReportDto;
import com.sleep.psy.external_server.business.evaluation.entity.dto.TrainingReport;
import com.sleep.psy.external_server.business.main.entity.MainUser;
import com.sleep.psy.external_server.result.Result;
import org.springframework.util.MultiValueMap;

import java.util.List;

/**
 * <p>
 * 测评报告 服务类
 * </p>
 *
 * @author wenliguo
 * @since 2025-08-12
 */
public interface EvaluationReportService extends IService<EvaluationReport> {

    /**
     * 获取匹兹堡简易报告
     * @author wenliguo
     * @date 2025/6/6 10:31
     * @param reportId 报告id
     * @return com.sleep.psy.main_server.result.Result
     */
    Result simpleSleepReport(Long reportId);

    /**
     * 获取匹兹堡专业报告
     * @author wenliguo
     * @date 2025/6/6 10:58
     * @param reportId 报告id
     * @return com.sleep.psy.main_server.result.Result
     */
    Result professionalSleepReport(Long reportId);


    /**
     * 获取通用报告
     * @author wenliguo
     * @date 2025/7/23 14:29
     * @param reportId 报告id
     * @return com.sleep.psy.main_server.result.Result
     */
    Result generalReport(Long reportId);

    /**
     * 获取睡眠问卷简易报告
     * @author wenliguo
     * @date 2025/6/6 15:27
     * @param reportId 报告id
     * @return com.sleep.psy.main_server.result.Result
     */
    Result simpleSleepQuestionReport(Long reportId);

    /**
     * 通过测评记录id获取有效测评报告
     * @author wenliguo
     * @date 2025/6/9 11:35
     * @param recordId 测评记录id
     * @return com.sleep.psy.main_server.business2.evaluation.entity.EvaluationReport
     */
    EvaluationReport selectReport(Long recordId);

    /**
     * 失眠严重指数量表简易报告
     * @author wenliguo
     * @date 2025/7/10 09:08
     * @param reportId 报告id
     * @return com.sleep.psy.main_server.result.Result
     */
    Result simpleIsiReport(Long reportId);


    /**
     * 请求php获取报告
     * @author wenliguo
     * @date 2025/7/25 10:15
     * @param map 请求参数
     * @return com.sleep.psy.main_server.business2.evaluation.entity.dto.ReportDto
     */
    ReportDto requestPhp(MultiValueMap<String, Object> map);

    /**
     * 通过用户id获取全部报告
     * @author wenliguo
     * @date 2025/8/18 09:21
     * @param userId 用户id
     * @return com.sleep.psy.external_server.result.Result
    */
    Result selectReportByUserId(Long userId);


    /**
     * 通过报告id获取报告
     * @author wenliguo
     * @date 2025/8/18 09:44
     * @param reportId 报告id
     * @return com.sleep.psy.external_server.result.Result
    */
    Result selectReportById(Long reportId);


    /**
     * 生成失眠问卷的报告
     * @author wenliguo
     * @date 2025/9/1 14:32
     * @param user 用户信息
     * @param record 测评信息
     * @param reportId 报告id
    */
    void generateSleeplessReport(MainUser user, EvaluationRecord record, Long reportId);

    /**
     * 通过用户id查询训练报告
     * @author wenliguo
     * @date 2025/9/9 11:46
     * @param userId 用户id
     * @return java.util.List<com.sleep.psy.external_server.business.evaluation.entity.dto.TrainingReport>
    */
    List<TrainingReport> selectTrainingReport(Long userId);
}
